import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import './AuditItem.less';

export default class AuditItem extends Component {
    render() {

        const {
            id,
            userName,
            phone,
            commission,
            auditStatus,
            applyTime
        } = this.props.info;

        return (
            <div className='audit-item'>
                <div className='card'>
                    <div className='audit-title'>
                        <span>审核状态</span>
                        {
                            auditStatus === 0 ?
                                <span className='not'>未审核</span> :
                                <span className='already'>已审核</span>
                        }
                    </div>
                    <div className='audit-content'>
                        {
                            (auditStatus === 0) && <Link to={`/audit/${id}`} className='audit-button'>前往审核</Link>
                        }
                        <div className='content-item'>
                            <span className='label'>代理姓名</span>
                            <span className='content-text'>{userName}</span>
                        </div>

                        <div className='content-item'>
                            <span className='label'>手机号码</span>
                            <span className='content-text'>{phone}</span>
                        </div>

                        <div className='content-item'>
                            <span className='label'>佣金价格</span>
                            <span className='content-text'>{commission}元/单</span>
                        </div>

                        <div className='content-item'>
                            <span className='label'>申请时间</span>
                            <span className='content-text'>{applyTime}</span>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}